<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="oastaglib" prefix="oas"%>
<html>
<head>
    <title>Online Attendance System</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bootstrap/dist/css/bootstrap.min.css" /> ">
    <script type="text/javascript" src="<c:url value="/resources/js/jquery/dist/jquery.min.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/resources/bootstrap/dist/js/bootstrap.min.js"/>"></script>
</head>
<body>
<oas:nav/>
<oas:content>
<h1>
    修改密码
</h1>
<form method="POST" style="width: 300px">
    原密码:
    <input class="form-control" type="password" name="oldPassword" id="newpwd"/><br/>
    密码:
    <input class="form-control" type="password" name="newPassword" id="oldpwd"/><br/>
    <input class="btn btn-primary" type="submit" value="提交修改" onclick="encode()"/><br/><br/>
    <a href="<c:url value="/" />">返回</a>
</form>
</oas:content>
<oas:footer />

<script>
    function encode() {
        let password = document.getElementById('newpwd');
        password.value = window.btoa(password.value);
        console.log(password.value);
        password = document.getElementById('oldpwd');
        password.value = window.btoa(password.value);
        console.log(password.value);
    }
</script>

</body>
</html>
